package com.mycompany.myapp.service.mapper;

import com.mycompany.myapp.domain.*;
import com.mycompany.myapp.service.dto.SUserDTO;

import org.mapstruct.*;

import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * Mapper for the entity {@link SUser} and its DTO {@link SUserDTO}.
 */
@Mapper(componentModel = "spring", uses = {})
public interface SUserMapper extends EntityMapper<SUserDTO, SUser> {

/*    @Mapping(target = "collections", ignore = true)
    @Mapping(target = "removeCollection", ignore = true)
    @Mapping(target = "orders", ignore = true)
    @Mapping(target = "removeOrder", ignore = true)
    @Mapping(target = "addresses", ignore = true)
    @Mapping(target = "removeAddress", ignore = true)
    @Mapping(target = "carts", ignore = true)
    @Mapping(target = "removeCart", ignore = true)*/
    SUser toEntity(SUserDTO sUserDTO);

    default SUser fromId(Long id) {
        if (id == null) {
            return null;
        }
        SUser sUser = new SUser();
        sUser.setId(id);
        return sUser;
    }
}
